//
//  SYS_MinePasswordCell.m
//  System_App
//
//  Created by 伟徐 on 2017/11/28.
//  Copyright © 2017年 czy001. All rights reserved.
//

#import "SYS_MinePasswordCell.h"

@implementation SYS_MinePasswordCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self.contentView addSubview:self.logoImg];
        [self.contentView addSubview:self.pswTextField];
        [self.contentView addSubview:self.lineLabel];
    }
    return self;
}

- (void)layoutSubviews{
    [_logoImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(20);
        make.centerY.mas_equalTo(self.contentView);
        make.size.mas_equalTo(CGSizeMake(40, 40));
    }];
    
    [_pswTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_logoImg.mas_right).offset(16);
        make.centerY.mas_equalTo(self.contentView);
        make.size.mas_equalTo(CGSizeMake(SCREENWIDTH-100, 40));
    }];
    
    [_lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(0);
        make.top.equalTo(self.contentView).offset(64);
        make.size.mas_equalTo(CGSizeMake(SCREENWIDTH, 1));
    }];
    
}


-(UIImageView *)logoImg{
    if(!_logoImg){
        _logoImg =[[UIImageView alloc] init];
        _logoImg.layer.cornerRadius = 20;
        _logoImg.layer.masksToBounds = YES;
    }
    return _logoImg;
}

-(UITextField *)pswTextField{
    if (!_pswTextField) {
         _pswTextField = [[UITextField alloc] init];
        [_pswTextField setValue:RGBACOLOR(190,189,189, 1) forKeyPath:@"_placeholderLabel.textColor"];
        _pswTextField.textAlignment =NSTextAlignmentLeft;
        _pswTextField.returnKeyType = UIReturnKeyDone;
        _pswTextField.font = [UIFont systemFontOfSize:16.f];
        _pswTextField.secureTextEntry=YES;
        _pswTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
        _pswTextField.keyboardType=UIKeyboardTypeNumbersAndPunctuation;
        _pswTextField.textColor = RGBACOLOR(51, 51, 51,1);
    }
    return _pswTextField;
}

-(UILabel *)lineLabel{
    if (!_lineLabel) {
        _lineLabel = [[UILabel alloc] init];
        _lineLabel.backgroundColor = RGBACOLOR(240,240,240, 1);
    }
    return _lineLabel;
}

@end
